import Mock from 'mockjs';
export default {
  'GET /api/custom/all': (req, res) => {
    let data = Mock.mock({
      result: true,
      msg: null,
      'data|6': [
        {
          'id|+1': 1,
          name: '@cname',
          code: '101',
          requestXml:
            '<html style="color:green"><!--thisisacomment--><head><title>HTMLExample</title></head><body>Theindentationtriestobe<em>somewhat&quot;dowhatImean&quot;</em>...butmightnotmatchyourstyle.</body></html>',
          responseXml:
            '<html style="color:green"><!--thisisacomment--><head><title>HTMLExample</title></head><body>Theindentationtriestobe<em>somewhat&quot;dowhatImean&quot;</em>...butmightnotmatchyourstyle.</body></html>',
          fsuTypeId: null,
          createTime: '2020-02-26 09:01:24',
          updateTime: '2020-02-26 09:09:04',
        },
      ],
      errorCode: null,
    });
    res.send(data);
  },
  'POST /api/flow/delete': (req, res) => {
    let data = Mock.mock({
      result: true,
      msg: null,
      data: null,
      errorCode: null,
    });
    res.send(data);
  },
  'POST /api/flow/update': (req, res) => {
    let data = Mock.mock({
      result: true,
      msg: null,
      data: null,
      errorCode: null,
    });
    res.send(data);
  },
  'POST /api/flow/add': (req, res) => {
    let data = Mock.mock({
      result: true,
      msg: null,
      data: null,
      errorCode: null,
    });
    res.send(data);
  },
  'GET /api/flow/all': (req, res) => {
    let data = Mock.mock({
      result: true,
      msg: null,
      'data|6': [{ 'id|+1': 0, name: '@cname' }],
      errorCode: null,
    });
    res.send(data);
  },
  'GET /api/flow/single': (req, res) => {
    let data = Mock.mock({
      result: true,
      msg: null,
      data: {
        id: 0,
        name: '',
        'content|1': [
          '{"nodes":[{"type":"node","size":"72*72","shape":"flow-circle","color":"#FA8C16","label":"开始/结束","schema":0,"method":"msg","data":{"msgId":47},"x":-301.912359113241,"y":5.189431855904516,"id":"2f5c9239","index":0},{"type":"node","size":"80*48","shape":"flow-rect","color":"#1890FF","label":"流程节点","schema":1,"method":"msSleep","data":{"ms":0},"x":-381.912359113241,"y":133.5227651892379,"id":"26f0aa7b","index":1}],"edges":[{"source":"2f5c9239","sourceAnchor":2,"target":"26f0aa7b","targetAnchor":1,"id":"19597337","index":2}]}',
        ],
      },
      errorCode: null,
    });
    res.send(data);
  },
  'GET /api/flow/queryMethod': (req, res) => {
    let data = Mock.mock({
      result: true,
      msg: null,
      data: [
        {
          method: 'msSleep',
          name: '等待（单位毫秒）',
          data: {
            ms: 0,
          },
          schema: [1],
        },
        {
          method: 'msg',
          name: '发送报文',
          data: {
            msgId: 0,
          },
          schema: [0, 1],
        },
        {
          method: 'saveFtp',
          name: '获取ftp信息',
          data: {
            msgId: 0,
          },
          schema: [1],
        },
        {
          method: 'uploadFile',
          name: 'ftp上传',
          data: {
            source: '',
            target: '',
          },
          schema: [1],
        },
        {
          method: 'downloadFile',
          name: 'ftp下载',
          data: {
            from: '',
            to: '',
          },
          schema: [1],
        },
      ],
      errorCode: null,
    });
    res.send(data);
  },
};
